using System;
using System.Web;
using PostSharp.Aspects;

namespace App_Code
{
    [Serializable]
    public class TraceAttribute : OnMethodBoundaryAspect
    {
        public override void OnEntry(MethodExecutionArgs args)
        {
            HttpContext.Current.Trace.Write( string.Format(  "Entering {0}.{1}", args.Method.DeclaringType.FullName, args.Method.Name ) );
        }

        public override void OnExit(MethodExecutionArgs args)
        {
            HttpContext.Current.Trace.Write(string.Format("Exiting {0}.{1}", args.Method.DeclaringType.FullName, args.Method.Name));
        }
    }
}